package pc.system;

public class Button
{

  public String name = null;
  private String img  = "disabled";
  private boolean enabled = true;
  //private boolean focused = false;

  public Button(String name)
  {
    this.name = name;
    setEnable(true);
  }

  private String getImage(String state)
  {
    return "buttons/" + state + "/"  + name + ".jpg";
  }

  public void setEnable(boolean enabled)
  {
    this.enabled = enabled;
    if (enabled) img = getImage("enabled");
    else img = getImage("disabled");
  }

  public void setFocus(boolean focused)
  {
    //this.focused = focused;
    if (focused) img = getImage("focused");
    else setEnable(enabled);
  }

  public String  getImage()
  {
    return img;
  }
}
